home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / Freeware / Swf_Player / Lib / adpcm.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-17  |  734 b   |  37 lines

  1. #ifndef _ADPCM_H_
  2. #define _ADPCM_H_
  3.  
  4. class Adpcm {
  5.  
  6.     // Destination format - note we always decompress to 16 bit
  7.     long         stereo;
  8.     int         nBits;  // number of bits in each sample
  9.  
  10.     long         valpred[2]; // Current state
  11.     int         index[2];
  12.  
  13.     long          nSamples; // number of samples decompressed so far
  14.  
  15.     // Parsing Info
  16.     unsigned char     *src;
  17.     long         bitBuf; // this should always contain at least 24 bits of data
  18.     int         bitPos;
  19.  
  20.     void FillBuffer();
  21.  
  22.     long GetBits(int n);
  23.  
  24.     long GetSBits(int n);
  25.  
  26. public:
  27.     Adpcm(unsigned char *buffer, long isStereo);
  28.  
  29.     void Decompress(short * dst, long n); // return number of good samples
  30. #ifdef DUMP
  31.     void dump(BitStream *bs);
  32.     void Compress(short *pcm, long n, int bits);
  33. #endif
  34. };
  35.  
  36. #endif /* _ADPCM_H_ */
  37.